﻿namespace PortableRiotGames.Interfaces.Stats
{
    using Newtonsoft.Json;
    using PortableRiotGames.Infrastructure;
    using PortableRiotGames.Infrastructure.Converters;
    using System;
    using System.Collections.Generic;

    [JsonObject(MemberSerialization.OptIn)]
    public sealed class GetRankedResponse : ResponseBase
    {
        /// <summary>
        /// List of aggregated stats summarized by champion.
        /// </summary>
        [JsonProperty("champions")]
        public List<GetRankedResponseChampionStat> Champions { get; set; }

        /// <summary>
        /// Date stats were last modified converted from epoch milliseconds.
        /// </summary>
        [JsonProperty("modifyDate")]
        [JsonConverter(typeof(JsonDateTimeMiliConverter))]
        public DateTime ModifyDate { get; set; }

        /// <summary>
        /// Summoner id associated with player.
        /// </summary>
        [JsonProperty("summonerId")]
        public long SummonerID { get; set; }
    }

    [JsonObject(MemberSerialization.OptIn)]
    public sealed class GetRankedResponseChampionStat
    {
        /// <summary>
        /// Champion id.
        /// </summary>
        [JsonProperty("id")]
        public int ID { get; set; }

        /// <summary>
        /// Champion name.
        /// </summary>
        [JsonProperty("name")]
        public string Name { get; set; }

        /// <summary>
        /// Aggregated stats associated with the champion.
        /// </summary>
        [JsonProperty("stats")]
        public AggregatedStats Stats { get; set; }
    }
}